home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / c / amiexpress / source / ae / code / acp3.00 / do_icons.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-18  |  1.7 KB  |  78 lines

  1. #include <exec/types.h>
  2. #include <workbench/workbench.h>
  3. #include <workbench/startup.h>
  4. #include <exec/libraries.h>
  5.  
  6. #include <clib/icon_protos.h>
  7. #include <clib/exec_protos.h>
  8. #include <clib/wb_protos.h>
  9. void do_appicon(struct MsgPort *myport);
  10. extern struct Library *SysBase;
  11. extern struct Library *IconBase;
  12. struct Library *WorkBenchBase;
  13.  
  14. struct DiskObject *dobj=NULL;
  15. struct AppIcon *appicon=NULL;
  16. struct Commands {
  17.     UBYTE    AcLvl[100],
  18.         SerDevUnit;
  19.     char    SerDev[40],
  20.         NEW_UserPW[15];
  21.     long    OpeningBaud;
  22.     BYTE    TaskPri;
  23.     char    ConfName[9][60],
  24.         ConfLoc[9][60],
  25.         BBSName[41],
  26.         BBSLoc[41],
  27.         SysopName[41];
  28.     UBYTE    PSAcLvl[6],
  29.         PSRType[6],
  30.         PSRatio[6];
  31.     long    PSDBytes[6],
  32.         PSTime[6];
  33.     char    PSCnfAc[6][10],
  34.         MInit[101],
  35.         MReset[31],
  36.         MRing[31],
  37.         MAnswer[31],
  38.         MC300[31],
  39.         MC1200[31],
  40.         MC2400[31],
  41.         MC4800[31],
  42.         MC9600[31],
  43.         MC19200[31];
  44.     short    NumConf;
  45.     char    SysPass[31],
  46.         RemotePass[31];
  47.     USHORT    BaudTimes[10];
  48.     char    Pad[18];
  49.     };
  50. extern struct Commands *Cmds[];
  51. extern WORD ZIM[3];
  52. void do_appicon(struct MsgPort *myport)
  53. {
  54.    char temp[100];
  55.    static int i=0;
  56.    static int j=0;
  57.   sprintf(temp,"%sStorage/Icons/Iconified",Cmds[0]->BBSLoc);
  58.     
  59.    if(!i)
  60.    {
  61.       sprintf(temp,"%sStorage/Icons/Iconified",Cmds[0]->BBSLoc);
  62.       WorkBenchBase=OpenLibrary("workbench.library",0L);
  63.       if(!(dobj=GetDiskObject(temp))) { dobj=GetDefDiskObject(WBDISK); j=1; }
  64.       dobj->do_Type=NULL; dobj->do_CurrentX=ZIM[0];
  65.                           dobj->do_CurrentY=ZIM[1];
  66.       dobj->do_Gadget.Flags=GFLG_GADGIMAGE;
  67.       appicon=AddAppIconA(0L,0L,"",myport,NULL,dobj,NULL);
  68.      
  69.       i=1;
  70.     }
  71.     else
  72.     {
  73.       i=0;
  74.       RemoveAppIcon(appicon);
  75.       FreeDiskObject(dobj);
  76.       CloseLibrary(WorkBenchBase);
  77.     }
  78. }